package com.marketapp.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonProperty;

@NamedQueries({ @NamedQuery(name = "getAllSector", query = "from Sector"),
		@NamedQuery(name = "getSectorByName",query= "from Sector sec where sec.sectorName=:sectorName"),
		@NamedQuery(name = "searchSectorByName",query= "from Sector sec where UPPER(sec.sectorName) LIKE :sectorName"
		)})
@Entity
@Table(name = "EQUITY_SECTOR")
public class Sector {
	
	private int sectorId;
	private String sectorName;

	public Sector() {

	}

	public Sector(int sectorId, String sectorName) {
		this.sectorId = sectorId;
		this.sectorName = sectorName;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "SECTOR_ID")
	public int getSectorId() {
		return sectorId;
	}

	public void setSectorId(int sectorId) {
		this.sectorId = sectorId;
	}

	@Column(name = "SECTOR_NAME")
	public String getSectorName() {
		return sectorName;
	}

	public void setSectorName(String sectorName) {
		this.sectorName = sectorName;
	}

}
